package com.xxx.springboot.distributedsession;

import java.util.Enumeration;
import java.util.Iterator;
import java.util.Set;

/**
 * session attribute name枚举
 */
public class AttributeNamesEnumeration implements Enumeration<String> {

    private final Iterator<String> iterator;

    public AttributeNamesEnumeration(Set<String> attributeNames) {
        this.iterator = attributeNames.iterator();
    }

    @Override
    public boolean hasMoreElements() {
        return iterator.hasNext();
    }

    @Override
    public String nextElement() {
        return iterator.next();
    }
}
